using System;
using Serpis;
namespace PVenta
{
	public partial class CategoriaView : Gtk.Window, IEntityView
	{
		public event EventHandler Changed;
		
		public CategoriaView () : base(Gtk.WindowType.Toplevel)
		{
			this.Build ();
			
			nombre.Changed += delegate {
				raiseChanged();
			};
		}
		
		[ModelProperty]
		public string Nombre {
			get {return nombre.Text;}
			set {nombre.Text = value ?? "";}
		}
		
		public Gtk.Action SaveAction {
			get {return saveAction;}
		}
		
		private void raiseChanged() {
			if(Changed != null) {
				Changed(this, EventArgs.Empty);
			}
		}
	}
}

